package com.tuling.lambda;

import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author: chenhs
 * @date: Created in 14:32 2022/8/9
 **/
public class PkTest2 {

    public static void main(String[] args)
    {

        List<JSONObject> list = new ArrayList<JSONObject>();
        list.add(JSONObject.parseObject("{\"id\":426052,\"questionId\":134336,\"optionDesc\":\"2.10%\",\"flag\":1}"));
        list.add(JSONObject.parseObject("{\"id\":426053,\"questionId\":134336,\"optionDesc\":\"2.50%\",\"flag\":0}"));
        list.add(JSONObject.parseObject("{\"id\":426054,\"questionId\":134336,\"optionDesc\":\"2.70%\",\"flag\":0}"));
        list.add(JSONObject.parseObject("{\"id\":426055,\"questionId\":134336,\"optionDesc\":\"5.00%\",\"flag\":0}"));
        System.out.println("打乱前：");
        for(int i=0;i<list.size();i++){
            System.out.print(list.get(i)+"    ");
        }
        System.out.println("");
        System.out.println("打乱后：");
        Collections.shuffle(list);
        for(int i=0;i<list.size();i++){
            System.out.print(list.get(i)+"    ");
        }
    }

}
